package com.nosnow.cms.controller;

import com.nosnow.cms.entity.CrmBanner;
import com.nosnow.cms.service.CrmBannerService;
import com.nosnow.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author bingheng
 * @since 2020-04-18
 */
@RestController
@RequestMapping("/cms/front/banner")
public class CrmBannerFrontController {

    @Autowired
    private CrmBannerService crmBannerService;

    /**
     * 查询所有的banner（轮播图）
     * @return
     */
    @GetMapping("getAllBanner")
    public R getAllBanner() {
        List<CrmBanner> list = crmBannerService.selectAllBanner();
        return R.ok().data("list", list);
    }


}
